package com.ctsig.chapter2.web;

import com.ctsig.chapter2.bean.TestBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by stephen on 2017/4/17.
 */
@RestController
public class UserController {
    @Value("${com.ctsig.hello}")
    private String hello ;
    @Value("${com.ctsig.world}")
    private String world ;

    @Autowired
    TestBean testBean ;

    @RequestMapping("/index")
    public String index(){
        return hello+world;
    }

    @RequestMapping("/index2")
    public String index2(){
        return testBean.getHello()+testBean.getWorld() ;
    }


}
